home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / docs / misc / amigapl.9903.lzh / amigapl.9903 / pci.lzx / Include / clib / pcires_protos.h < prev   
Encoding:
C/C++ Source or Header  |  1998-03-24  |  2.7 KB  |  129 lines

  1. #ifndef  CLIB_PCIRES_PROTOS_H
  2. #define  CLIB_PCIRES_PROTOS_H
  3.  
  4. /*
  5. **    $VER: pcires_protos.h 1.0 (22.12.97)
  6. **    Includes Release 1.0
  7. **
  8. **    C prototypes. For use with 32 bit integers only.
  9. **
  10. **    (C) Copyright 1997-1998 MicroniK
  11. **        All Rights Reserved
  12. */
  13.  
  14. #include <resources/pci.h>
  15.  
  16. /*
  17. **
  18. **  Allow access to PCI bus, to specified PCI area
  19. **  (IO or MEMORY). Use semaphore-based access control
  20. **  fill request.request substructure 
  21. **  Do not modify other fields !!!
  22. ** 
  23. */
  24. ULONG ObtainPCIPage(struct PCIMapping * request);
  25.  
  26. /*
  27. **
  28. ** Frees PCI bus - allow another process to use PCI
  29. ** Return information about errors on PCI bus
  30. ** 
  31. */
  32. ULONG ReleasePCIPage(struct PCIMapping * request);
  33.  
  34. /*
  35. **
  36. ** Change PCI bus address - quick way to access other addresses
  37. ** You cant change space, size and flags
  38. ** Return information about errors on PCI bus
  39. ** 
  40. */
  41. ULONG MovePCIPage(struct PCIMapping * request);
  42.  
  43. /* 
  44. **
  45. **  Check errors on PCI bus
  46. **  Return the same information as ReleasePCIPage
  47. **  but dont change PCI page status
  48. **
  49. */
  50. ULONG PCIPageStatus(struct PCIMapping *request);
  51.  
  52.  
  53. /*
  54. ** 
  55. **  Read configuration register of PCI card
  56. **  Return register value or 0xFFFFFFFF if you
  57. **  select empty slot - usefull only
  58. **  when reading card ID register (regno = 0)
  59. **
  60. */
  61. ULONG ReadCfgReg(UBYTE slotno, UBYTE regno);
  62.  
  63. /*
  64. **
  65. **  Write configuration register regno of PCI card 
  66. **  plugged into slot no slotno.
  67. **  Return 1 - OK 0 - slot empty
  68. **
  69. */
  70. ULONG WriteCfgReg(UBYTE slotno, UBYTE regno, ULONG value);
  71.  
  72. /* 
  73. **
  74. **   Allocate/init and free PCIMapping structure
  75. **
  76. */
  77. struct PCIMapping * AllocPCIMapping(void);
  78. void FreePCIMapping(struct PCIMapping * map);
  79.  
  80.  
  81. /* 
  82. ** for use in interrupt servers
  83. */
  84. /*
  85. **
  86. **  Allow access to PCI bus, to specified PCI area
  87. **  (IO or MEMORY). For using in interrupt servers
  88. **  fill request.request substructure 
  89. **  Do not modify other fields !!!
  90. ** 
  91. */
  92. ULONG StorePCIPage(struct PCIMapping * request);
  93.  
  94. /*
  95. **
  96. ** Frees PCI bus - allow another process to use PCI
  97. ** Return information about errors on PCI bus
  98. ** use in the same interrupt as StorePCIPage -
  99. ** do not exit interrupt server with PCI page 'stored'
  100. ** 
  101. */
  102. ULONG RestorePCIPage(struct PCIMapping * request);
  103.  
  104. /*
  105. ** 
  106. **  Read configuration register of PCI card
  107. **  Return register value or 0xFFFFFFFF if you
  108. **  select empty slot - usefull only
  109. **  when reading card ID register (regno = 0)
  110. **  For using in single-task environment
  111. **  eg. in interrupt servers
  112. **
  113. */
  114. ULONG IntReadCfgReg(UBYTE slotno, UBYTE regno);
  115.  
  116. /*
  117. **
  118. **  Write configuration register regno of PCI card 
  119. **  plugged into slot no slotno.
  120. **  Return 1 - OK 0 - slot empty
  121. **  For using in single-task environment
  122. **  eg. in interrupt servers
  123. **
  124. */
  125. ULONG IntWriteCfgReg(UBYTE slotno, UBYTE regno, ULONG value);
  126.  
  127. #endif     /* CLIB_PCIRES_PROTOS_H */
  128.  
  129.